package com.fansl.allround.common.log.event;

import com.fansl.allround.common.core.constant.SecurityConstants;
import com.fansl.allround.upms.api.entity.SysLog;
import com.fansl.allround.upms.api.feign.RemoteLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/7/11 17:44
 */
@Slf4j
@AllArgsConstructor
public class SysLogListener {
    private final RemoteLogService remoteLogService;

    public void saveSysLog(SysLogEvent sysLogEvent){
        SysLog sysLog = (SysLog) sysLogEvent.getSource();
        remoteLogService.saveLog(sysLog,SecurityConstants.FROM_IN);
    }
}
